#include "plug/plugObject.h"
#include "common/common.h"
#define PLUGNAME "jpegcode"
#define PLUGGROUP GROUT_CODE

depend jpegCode_depend[]={
	{NULL,DEPEND_IN,GROUP_IN},
	{NULL,DEPEND_OUT,GROUP_OUT}
};

pPlugObject init(PVOID handle )
{
	pPlugObject t	= (pPlugObject)malloc(sizeof(pPlugObject));
	if(!t)
	{
		ERR_RETURN( NULL);
	}
	strcpy(t.name,PLUGNAME);
	t->group	= PLUGGROUP;
	t->dlhandle = handle;
	t->dependList	= list_init(&t.dependList);
	t->inList	= list_init(&t.inList);
	t->outList	= list_init(&t.outList);
	t->addOut	= super_addOut;
	t->delOut	= super_delOut;
	t->thread_main	= jpegCode_thread_main;
	t->thread_run	= jpegCode_thread_run;
/*add depend to dependList,ignore return check*/
	super_add_depend_list(t,jpegCode_depend[0]);
	super_add_depend_list(t,jpegCode_depend[1]);
	t->destroy  = jpegCode_destroy;
	return t;
}

INT32 jpegCode_destroy(pPlugObject t)
{
    ASSER(t);
    list_free(inList);
    list_free(outList);
    list_free(dependList);
    //stop thread
    //dlclose
    //free pPlugObject
}



